package cn.wolfcode.enums;

import lombok.Getter;

@Getter
public enum NoticeEnum {
    URGENT("紧急",0),
    IMPORTANT("重要",1),
    ORDINARY("普通",2);

    private String name;
    private Integer value;

    NoticeEnum(String name, Integer value){
        this.name = name;
        this.value = value;
    }

    public static String findName(Integer value){
        //获取所有示例
        NoticeEnum[] enums = values();
        for (NoticeEnum anEnum : enums) {
            //判断实例中的value是否等于传入的value
            if(anEnum.value.equals(value)){
                return anEnum.name;
            }
        }
        return null;
    }
}
